package main

import (
	"github.com/gin-gonic/gin"
	"github.com/go-starter/api"
	_ "github.com/go-starter/docs"
	swaggerFiles "github.com/swaggo/files"
	ginSwagger "github.com/swaggo/gin-swagger"
)

// @title           Go Starter API
// @version         1.0
// @description     A Gin framework based API starter template
// @termsOfService  http://swagger.io/terms/

// @contact.name   API Support
// @contact.url    http://www.example.com/support
// @contact.email  support@example.com

// @license.name  MIT
// @license.url   https://opensource.org/licenses/MIT

// @host      localhost:8080
// @BasePath  /api

// @securityDefinitions.basic  BasicAuth
func main() {
	r := gin.Default()
	
	// 注册API路由
	api.RegisterRoutes(r)
	
	// Swagger文档
	r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))
	
	// 启动服务器
	r.Run(":8080")
}